package com.hx.staticState.demo2;

/**
 * @Author： Huathy
 * @ClassPath： com.hx.staticState.demo2.UserServiceImplProxy
 * @Date： 2021-02-04 10:58
 * @Description：
 */
public class UserServiceImplProxy implements UserService {
    private UserService userService;

    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    @Override
    public void add() {
        log("ADD");
        userService.add();
    }

    @Override
    public void delete() {
        log("DELETE");
        userService.delete();
    }

    @Override
    public void update() {
        log("UPDATE");
        userService.update();
    }

    @Override
    public void query() {
        log("QUERY");
        userService.query();
    }

    public void log(String msg) {
        System.out.println("==== " + msg + " METHOD ====");
    }
}
